getaddrinfo-is-threadsafe
authorDebian OpenLDAP Maintainers <pkg-openldap-devel@lists.alioth.debian.org>
Fri, 2 Dec 2016 03:40:20 +0000 (03:40 +0000)
committerRyan Tandy <ryan@nardis.ca>
Fri, 2 Dec 2016 03:40:20 +0000 (03:40 +0000)
commit5c13bad9b9d504dde071d6c9bea1d736176c7b24
treea5da8f81fa12bc4b3dfbeba2dec3c661e350cdb4
parent52f0c849b2a23b1c5b9bd3ba599ab565dde290ad
getaddrinfo-is-threadsafe

OpenLDAP upstream conservatively assumes that certain resolver functions
(getaddrinfo, getnameinfo, res_query, dn_expand) are not re-entrant; but we
know that the glibc implementations of these functions are thread-safe, so
we should bypass the use of this mutex.  This fixes a locking problem when
an application uses libldap and libnss-ldap is also used for hosts
resolution.

Closes Debian bug #340601.

Not suitable for forwarding upstream; might be made suitable by adding a
configure-time check for glibc and disabling the mutex only on known
thread-safe implementations.

Gbp-Pq: Name getaddrinfo-is-threadsafe
libraries/libldap/os-ip.c
libraries/libldap/util-int.c